<!DOCTYPE HTML>
<html lang="cn" xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">
<head>
    <%include("/common/header.html",{title:''}){}%>
    <title>告警管理</title>
    <style>
    </style>
</head>

<body>

<div class="x-nav" style="margin: 20px auto auto 15px;">
      <span class="layui-breadcrumb" lay-filter="breadcrumb" style="visibility: visible;">
        <a href="javascript:">首页</a><span lay-separator="">/</span>
        <a href="javascript:">告警管理</a><span lay-separator="">/</span>
        <a><cite>告警列表</cite></a>
      </span>
    <a class="layui-btn layui-btn-primary layui-btn-small" style="margin: -5px 14px 0px 0px;float:right;"
       href="javascript:location.replace(location.href);" title="刷新">
        <i class="layui-icon layui-icon-refresh-3"></i>
    </a>
</div>
<div class="layui-fluid">
    <div class="layui-card">
        <table id="LAY-user-manage" lay-filter="LAY-user-manage"></table>


<!--        <script type="text/html" id="table-useradmin-webuser">-->
<!--            <a class="layui-btn  layui-btn-xs" lay-event="tj"><i class="layui-icon layui-icon-release"></i>创建工单</a>-->
<!--        </script>-->
    </div>
</div>
<script type="text/html" id="state">
    {{#  if(d.stitas === '0'){ }}
   已解决
    {{#  } else{ }}
    未解决
    {{#  } }}
</script>
<script type="text/html" id="level">
    {{#  if(d.level === '高级告警'){ }}
    <span style="color: #ffffff;">{{ d.level}}</span>
    {{#  } else { }}
    {{ d.level }}
    {{#  } }}
</script>
<script type="text/html" id="currentvalue">
    {{#  if(d.level === '高级告警'){ }}
    <span style="color: #ff0000;">{{ d.currentvalue}}</span>
    {{#  } else { }}
    {{ d.currentvalue }}
    {{#  } }}
</script>

<%include("/common/foot.html"){}%>
<script>
    $(function(){


    });
    layui.use(['index', 'table', 'form', 'laydate', 'layedit', 'AjaxCommon', 'AliangLayui'], function () {
        var $ = layui.$;
        var table = layui.table;
        var form = layui.form;
        var laydate = layui.laydate;
        var AjaxCommon = layui.AjaxCommon;
        var AliangLayui = layui.AliangLayui;
        var title = "告警列表";
        var findAll_url = 'alarm/list.json';
        var index;//定义建立富文本编辑器全局变量
        var layedit;//定义富文本编辑器layedit全局变量
        var cols = [ //表头
            {field: 'level',   title: '级别', templet:'#level', style:'background-color: #ff0000;'},
            {field: 'alarmtime',   title: '发生时间',templet: "<div>{{layui.util.toDateString(d.alarmtime,'yyyy-MM-dd HH:mm:ss')}}</div>"},
            {field: 'typecode',  sort:'true' , title: '类别',},
            {templet: "<div>{{d.departProjectData.dataName}}</div>", sort: true,  title: '点位',},
            {field: 'currentvalue',  sort:'true' , title: '实际值',templet:'#currentvalue'},
            {field: 'setvalue',  sort:'true' , title: '设定值',},
            // {field: 'stitas',  sort:'true' , title: '状态', templet:'#state'},
            // {title: '操作', fixed: 'right', width: 215, toolbar: '#table-useradmin-webuser',}
        ];
        AliangLayui.createTable(
            "#LAY-user-manage",
            "listReload",
            "#toolbarDemo",
            title,
            findAll_url,
            true,
            [10, 15, 20, 25],
            ['filter', 'print', 'exports'],
            cols,
            null
        );


        //点击每行右工具栏“操作”里面按钮效果
        table.on('tool(LAY-user-manage)', function (obj) {
            var data = obj.data;
            if (obj.event === 'tj') {
                window.location.href="base/link/@/patrol/list.jhtml"
            }
        });

    });

</script>


</body>

</html>
